Skip to content

Conversation

cometkim
Copy link
Member

@cknitt
Copy link
Member

cknitt commented Jul 25, 2024

Ok for me to add this, just two remarks:

  1. We should then add it to Core, too.
  2. IMHO, in the docs, we should rather promote the practice of creating explicit bindings using globalThis, like
@scope("globalThis")
external window: option<Dom.window> = "window"

instead of using

Js.globalThis["window"]

@cometkim
Copy link
Member Author

at least Js.globalThis["window"] is better than %raw("window") 😉

@cometkim
Copy link
Member Author

cometkim commented Jul 26, 2024

We should then add it to Core, too.

We already have in https://github.com/rescript-association/rescript-core/blob/22642ea/src/RescriptCore.res#L49, but there is a mismatch in the window usecase

Reported to rescript-lang/rescript-core#240

@cometkim
Copy link
Member Author

I'm merging this, globalThis already in the Core with the same signature

@cometkim cometkim merged commit b16c66f into rescript-lang:master Jul 29, 2024
19 checks passed
@cometkim cometkim deleted the js-global-this branch July 29, 2024 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants